<template>
  <div>
    <svg :style="{ width: width, height: height }">
      <use :xlink:href="prefix + name" :fill="color"></use>
    </svg>
  </div>
</template>

<script setup>
defineProps({
  prefix: {
    type: String,
    default: '#icon-',
  },
  //接收父组件传过来的名字字段
  name: String,
  //接收父组件传过来的颜色字段
  color: {
    type: String,
    default: 'blue',
  },
  //收父组件传过来的尺寸字段
  width: {
    type: String,
    default: '16px',
  },
  height: {
    type: String,
    default: '16px',
  },
})
</script>

<style lang="scss" scoped></style>
